/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cehadata;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 *
 * @author Gilles
 */
@Entity
@Table(name = "fiche", catalog = "ceha", schema = "")
@NamedQueries({@NamedQuery(name = "Fiche.findAll", query = "SELECT f FROM Fiche f"), @NamedQuery(name = "Fiche.findById", query = "SELECT f FROM Fiche f WHERE f.id = :id"), @NamedQuery(name = "Fiche.findBySource", query = "SELECT f FROM Fiche f WHERE f.source = :source"), @NamedQuery(name = "Fiche.findByAuteur", query = "SELECT f FROM Fiche f WHERE f.auteur = :auteur"), @NamedQuery(name = "Fiche.findByDate", query = "SELECT f FROM Fiche f WHERE f.date = :date"), @NamedQuery(name = "Fiche.findByDatetexte", query = "SELECT f FROM Fiche f WHERE f.datetexte = :datetexte"), @NamedQuery(name = "Fiche.findByLienimage", query = "SELECT f FROM Fiche f WHERE f.lienimage = :lienimage"), @NamedQuery(name = "Fiche.findByLienfichier", query = "SELECT f FROM Fiche f WHERE f.lienfichier = :lienfichier"), @NamedQuery(name = "Fiche.findByTypedocument", query = "SELECT f FROM Fiche f WHERE f.typedocument = :typedocument"), @NamedQuery(name = "Fiche.findByFond", query = "SELECT f FROM Fiche f WHERE f.fond = :fond"), @NamedQuery(name = "Fiche.findByDatedonation", query = "SELECT f FROM Fiche f WHERE f.datedonation = :datedonation"), @NamedQuery(name = "Fiche.findByDroitsrepro", query = "SELECT f FROM Fiche f WHERE f.droitsrepro = :droitsrepro"), @NamedQuery(name = "Fiche.findByDimension", query = "SELECT f FROM Fiche f WHERE f.dimension = :dimension"), @NamedQuery(name = "Fiche.findByDatecorrection", query = "SELECT f FROM Fiche f WHERE f.datecorrection = :datecorrection"), @NamedQuery(name = "Fiche.findByIdcorrecteur", query = "SELECT f FROM Fiche f WHERE f.idcorrecteur = :idcorrecteur")})
public class Fiche implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Lob
    @Column(name = "imagefilename")
    private String imagefilename;
    @Column(name = "source")
    private Boolean source;
    @Basic(optional = false)
    @Lob
    @Column(name = "titre")
    private String titre;
    @Column(name = "auteur")
    private String auteur;
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Column(name = "datetexte")
    private String datetexte;
    @Lob
    @Column(name = "resume")
    private String resume;
    @Column(name = "lienimage")
    private String lienimage;
    @Column(name = "lienfichier")
    private String lienfichier;
    @Column(name = "typedocument")
    private String typedocument;
    @Column(name = "fond")
    private String fond;
    @Column(name = "datedonation")
    @Temporal(TemporalType.DATE)
    private Date datedonation;
    @Column(name = "droitsrepro")
    private String droitsrepro;
    @Lob
    @Column(name = "localisation")
    private String localisation;
    @Column(name = "dimension")
    private String dimension;
    @Column(name = "datecorrection")
    private Integer datecorrection;
    @Column(name = "idcorrecteur")
    private Integer idcorrecteur;

    public Fiche() {
    }

    public Fiche(Integer id) {
        this.id = id;
    }

    public Fiche(Integer id, String titre) {
        this.id = id;
        this.titre = titre;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        changeSupport.firePropertyChange("id", oldId, id);
    }

    public String getImagefilename() {
        return imagefilename;
    }

    public void setImagefilename(String imagefilename) {
        String oldImagefilename = this.imagefilename;
        this.imagefilename = imagefilename;
        changeSupport.firePropertyChange("imagefilename", oldImagefilename, imagefilename);
    }

    public Boolean getSource() {
        return source;
    }

    public void setSource(Boolean source) {
        Boolean oldSource = this.source;
        this.source = source;
        changeSupport.firePropertyChange("source", oldSource, source);
    }

    public String getTitre() {
        return titre;
    }

    public void setTitre(String titre) {
        String oldTitre = this.titre;
        this.titre = titre;
        changeSupport.firePropertyChange("titre", oldTitre, titre);
    }

    public String getAuteur() {
        return auteur;
    }

    public void setAuteur(String auteur) {
        String oldAuteur = this.auteur;
        this.auteur = auteur;
        changeSupport.firePropertyChange("auteur", oldAuteur, auteur);
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        Date oldDate = this.date;
        this.date = date;
        changeSupport.firePropertyChange("date", oldDate, date);
    }

    public String getDatetexte() {
        return datetexte;
    }

    public void setDatetexte(String datetexte) {
        String oldDatetexte = this.datetexte;
        this.datetexte = datetexte;
        changeSupport.firePropertyChange("datetexte", oldDatetexte, datetexte);
    }

    public String getResume() {
        return resume;
    }

    public void setResume(String resume) {
        String oldResume = this.resume;
        this.resume = resume;
        changeSupport.firePropertyChange("resume", oldResume, resume);
    }

    public String getLienimage() {
        return lienimage;
    }

    public void setLienimage(String lienimage) {
        String oldLienimage = this.lienimage;
        this.lienimage = lienimage;
        changeSupport.firePropertyChange("lienimage", oldLienimage, lienimage);
    }

    public String getLienfichier() {
        return lienfichier;
    }

    public void setLienfichier(String lienfichier) {
        String oldLienfichier = this.lienfichier;
        this.lienfichier = lienfichier;
        changeSupport.firePropertyChange("lienfichier", oldLienfichier, lienfichier);
    }

    public String getTypedocument() {
        return typedocument;
    }

    public void setTypedocument(String typedocument) {
        String oldTypedocument = this.typedocument;
        this.typedocument = typedocument;
        changeSupport.firePropertyChange("typedocument", oldTypedocument, typedocument);
    }

    public String getFond() {
        return fond;
    }

    public void setFond(String fond) {
        String oldFond = this.fond;
        this.fond = fond;
        changeSupport.firePropertyChange("fond", oldFond, fond);
    }

    public Date getDatedonation() {
        return datedonation;
    }

    public void setDatedonation(Date datedonation) {
        Date oldDatedonation = this.datedonation;
        this.datedonation = datedonation;
        changeSupport.firePropertyChange("datedonation", oldDatedonation, datedonation);
    }

    public String getDroitsrepro() {
        return droitsrepro;
    }

    public void setDroitsrepro(String droitsrepro) {
        String oldDroitsrepro = this.droitsrepro;
        this.droitsrepro = droitsrepro;
        changeSupport.firePropertyChange("droitsrepro", oldDroitsrepro, droitsrepro);
    }

    public String getLocalisation() {
        return localisation;
    }

    public void setLocalisation(String localisation) {
        String oldLocalisation = this.localisation;
        this.localisation = localisation;
        changeSupport.firePropertyChange("localisation", oldLocalisation, localisation);
    }

    public String getDimension() {
        return dimension;
    }

    public void setDimension(String dimension) {
        String oldDimension = this.dimension;
        this.dimension = dimension;
        changeSupport.firePropertyChange("dimension", oldDimension, dimension);
    }

    public Integer getDatecorrection() {
        return datecorrection;
    }

    public void setDatecorrection(Integer datecorrection) {
        Integer oldDatecorrection = this.datecorrection;
        this.datecorrection = datecorrection;
        changeSupport.firePropertyChange("datecorrection", oldDatecorrection, datecorrection);
    }

    public Integer getIdcorrecteur() {
        return idcorrecteur;
    }

    public void setIdcorrecteur(Integer idcorrecteur) {
        Integer oldIdcorrecteur = this.idcorrecteur;
        this.idcorrecteur = idcorrecteur;
        changeSupport.firePropertyChange("idcorrecteur", oldIdcorrecteur, idcorrecteur);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fiche)) {
            return false;
        }
        Fiche other = (Fiche) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cehadata.Fiche[id=" + id + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
